DVIM72-Mac is an application which allows you to print TeX .dvi files (such as those created by OzTeX, the public-domain implementation of TeX for Macintosh) on an Apple Imagewriter. It may also work for certain other dot-matrix printers, or even non-PostScript laser printers. Note that compatibility may depend not only upon your printing hardware, but also upon the quality of your printer driver software.
No Warranty
-----------
This software is provided ╥as is╙ and is not guaranteed in any way. In fact it was constructed by an amateur, and you should be thankful if it works at all.
Resolution
----------
The ╥Resolution╔╙ item in the Configure menu allows you to set the resolution of your fonts and your printer. The font resolution must be set equal to or greater than the printer resolution. These settings involve tradeoffs between RAM, disk space, printing speed, and of course print quality.
RAM: The amount of RAM needed by DVIM72-Mac can be expected to increase approximately as the square of the font resolution. For instance 500K may be suficient for a font resolution setting of 144dpi, but you may need more like 1500K if your font resolution is set to 300dpi. The amount of RAM needed also depends upon the number of different fonts used in your documents.
Disk space: If you set the font resolution to 300dpi, you can use the 300dpi fonts provided with OzTeX. Otherwise you╒d need to build or copy some TeX fonts at the appropriate resolution. DVIM72-Mac uses standard TeX fonts in the PK (packed) format, so you could build the fonts on some other computer that runs Metafont.
I built some 144dpi fonts on a VAX/VMS computer. These fonts are available for anonymous FTP at the OzTeX sites midway.uchicago.edu and giza.cis.ohio-state.edu.
Printing speed: This is mostly affected by the printer resolution setting.
Print quality: You will obtain the best output if the font resolution and the printer resolution are set to the highest resolution of which your printer is capable (144dpi for ImageWriters, 216dpi for ImageWriter LQ.) If you set the font resolution higher than the printer resolution, the results will be slightly inferior.
Fonts
-----
A reasonable way to organize the fonts is to have one folder for Imagewriter fonts, with a subfolder for each magnification. For instance, you might have a folder named ╥IWfonts╙ containing subfolders named ╥72╙, ╥86╙, and ╥104╙ for 72dpi fonts. The names of the fonts can have several formats. For instance, the ╥cmr8╙ font at 72dpi and magstep 1 would be a member of the ╥86╙ folder named ╥cmr8╙, ╥cmr8.pk╙, or ╥cmr8.86pk╙. See the ╥Font name format╙ choice in the ╥Font Options╔╙ dialog.
At present, the program rounds font magnifications to magsteps or half-magsteps. Thus, for instance, if your TeX document calls for cmr10 at 40pt at 144dpi, you might think that the program would look for the font 576:cmr10 (since 4 * 144 = 576), but it would actually look for 565:cmr10. That is because magstep 7.5 is the closest half-integral magnification to magnification by 4.
The ╥Configure╙ Menu
---------------------
The Configure menu allows you to set several persistent parameters. The most important thing to set, before you try to print anything, is the font folder path. This should be a full path name, from the name of your hard disk down to the folder containing the Imagewriter fonts. Just select ╥Font Paths╔╙ from the Configure menu, click on ╥Font folder path╙, navigate the Standard File dialog until you are looking at the contents of the desired folder, and click the ╥Select current folder╙ button.
The ╥Font name format╙ popup menu (shown below) also affects the way the program will search for font files. If your font files are arranged in subfolders according to magnification as recommended above, then it is safe to check the second, third, and fourth formats. (The fifth, sixth, and seventh are provided for A/UX. I don't know whether DVIM72-Mac runs under A/UX.)
╩
The ╥default hoffset╙ and ╥default voffset╙ parameters affect the position of printed material on the paper. The correct settings depend upon how you load paper in your ImageWriter. These distances can be expressed in the usual TeX dimensions: points, inches, millimeters, etc.
Under ╥Printing Options╔╙, you have a 3 paper feed choices, ╥Use Driver Default╙, ╥Auto Feed╙, and ╥Hand Feed╙. For printers other than ImageWriters, ╥Use Driver Default╙ is the safest choice.
You have a choice of 3 printing methods, ╥Use Driver Default╙, ╥Draft╙ or ╥Spooled╙. There is NO difference in the quality of the output, it's just a question of whether each page is printed immediately or is saved to a file and printed when all pages are done. Furthermore, ╥spooling╙ does not mean background printing. When you print to an ImageWriter in a normal Macintosh application using ╥Best╙ or ╥Faster╙ quality, that's spooled printing. Draft-mode printing is a little bit more efficient, but spooled mode is more likely to work on printers other than ImageWriters. Spooling may also be advisable if your printer is on a network. And for some reason that I don't understand, automatic form-feeding works more precisely in spooled mode. For printers other than ImageWriters, ╥Use Driver Default╙ is the safest choice.
The optional memory monitor window allows you to see how close you are to running out of memory, so that you will be able to make a more informed choice of the right MultiFinder partition size. See ╥Memory Requirements╙ below.
The ╥Print╔╙ Dialog
-----------------
The ╥Print╔╙ dialog is much like the standard Imagewriter Print dialog, in that you can set the pages to be printed, the number of copies, and auto feed vs. hand feed. Be warned that the page numbers are ╥dvi pages╙, not ╥TeX pages╙. That is, even if TeX's page counter has the values 0, 0, and 3, DVIM72-Mac will still consider them to be numbered 1, 2, 3.
The one unfamiliar item in the ╥Print╔╙ dialog is ╥Other commands╙. This is a holdover from the program's past as a command with Unix-style options. Certain obscure options can be specified only this way. For instance, suppose DVIM72-Mac is having trouble finding your fonts. To find out where it is looking for them, type ╥-d24╙ in the ╥Other commands╙ box. This will display messages in the console window whenever DVIM72-Mac attempts to open a file. Or suppose that you have a 10-page paper, but for some reason want to print only the even-numbered pages. Instead of specifying pages with the ╥From╙ and ╥To╙ boxes, put ╥-o2:10:2╙ in the ╥Other commands╙ box.
The ╥Just Print...╙ Menu Choice
---------------------------
"Just Print╔╙ begins with a Standard File dialog, like ╥Print╔╙, but does not bring up a print job dialog. It assumes that you want one copy of all pages in the document.
The ╥Page Setup╔╙ Menu Choice
----------------------------
You can set the paper size here. However, the actual image built in DVIM72-Mac's memory is for U.S. Letter sized paper, regardless.
PICT File \specials
-----------------
It is possible to include a PICT image in a TeX document to be printed with DVIM72-Mac. The syntax is \special{pict pathname}, where ╘pathname╒ is either an absolute pathname or a path relative to the folder containing the dvi file. (The ╘pict ╒ prefix is supposed to distinguish PICT \specials from PostScript \specials.) In particular, if the PICT file is in the same folder as the dvi file, it should be sufficient to use the filename. As usual, TeX sees a \special as a box of zero height and width. It╒s up to you to leave room for the picture.
Font Substitution
----------------
Suppose you have a document that contains the font cmr7 at magstep 4, but you don't have that font file around. A reasonable substitute would be cmr10 at magstep 2. You can specify such substitutions in a special font substitution file, a file named ╥texfonts.sub╙ located in your font folder. In the example above, the file would contain the line
cmr7.1493 -> cmr7.1037
The number 1493 comes from the calculation 144 * 5 * 1.2**4, rounded to the nearest integer. The 144 is the resolution; obviously, if you are using 72dpi fonts, use the number 72 here instead. Never mind where the 5 comes from.
Memory Requirements
-------------------
I have set the Multifinder partition size at 550K, but the amount of memory you need depends on how many fonts you use and your choice of font resolution. See the discussion of resolution setting above. Unfortunately, the program does not warn you nicely when it's about to run out of memory, it just quits. So be generous with RAM, if you can.
An optional free memory indicator (which can be turned on or off with the ╥Memory Options╔╙ dialog) will let you see whether you are close to running out of memory. The dark grey area represents free memory (also given numerically above the bar) and the light grey area represents memory that can be freed by purging code or resources.
╩
There is also an option to use the system heap for font memory when the application heap runs low. This is a somewhat risky thing to do; for one thing, if stuff gets put into the system heap and then DVIM72-Mac quits abnormally, the stuff will stay in the system heap until you reboot. This option is ONLY of use if you are running MultiFinder and are short of memory. Of course, it doesn't create memory from nothing, it just allows you to set DVIM72-Mac's partition size smaller.
When you use the system heap option, the memory window will also show system heap memory.
╩
The Console Window and Log FIle
-----------------------------
The text displayed in the console window is also recorded in a file named ╥cons.log╙. This might occasionally be useful if error messages go by too fast to read.
About DVIM72-Mac
-----------------
DVIM72-Mac is derived from dvim72, one of Nelson Beebe's family of public-domain portable dvi drivers. It was ported to the Macintosh by James W. Walker using THINK C 4.0. It is free software. The copyright notice in the ╥About╔╙ box is simply to ensure that it remains free, and to protect Symantec's copyright on the portions of the code derived from THINK C. You can give copies to others or post it on electronic bulletin boards, put please be sure that these documents always accompany it.
The program, source code, and ImageWriter fonts will be available
at the U.S. OzTeX FTP sites, giza.cis.ohio-state.edu and midway.uchicago.edu.
New versions appear first at the former site.
Please tell me about ideas for improvements. But of course, since I'm not getting paid for this, I don't promise to act on such suggestions quickly.
Author's address:
James W. Walker
Department of Mathematics
University of South Carolina
Columbia, SC 29208
Internet e-mail: 76367.2271@compuserve.com
America Online: JWWalker
Note to Imagewriter I users
-------------------------
I observed that whenever I printed something, there was about a 10-second pause when nothing seemed to be happening. In DVIM72-Mac, the beachball cursor stops spinning; the time at which this happens depends upon whether you use draft or spooled printing. An Apple employee informed me that the Imagewriter driver sends a ╥who are you?╙ message to the printer, but the Imagewriter I is too dumb to respond, so the request times out. I suppose that's fine if you want to support lots of printers, but if you have only one printer, and it's an Imagewriter I, it's a little annoying. So, I used Macsbug to disassemble some code in the Imagewriter file. I don't know much about assembly language, but I could tell that there were several places where the program waits for something to happen, with a fixed time limit. There were several 20-second waits (I don't know what for), two 3-second waits, and two 7-second waits. Apparently, there's a 3 and a 7 for spooled mode, and a 3 and a 7 for draft mode. Well, I converted each of those four numbers to 0-second waits, and it seems to work.
Here's how to make the patch. First, make a copy of the ImageWriter file, and rename it ╥Patched ImageWriter╙. Then open Patched ImageWriter with ResEdit. We'll need to patch the file in 4 places. Open the PDEF resource number 0. At offset 14F2, replace the hex string A975 261F 0683 0000 00B4 by A975 261F 0683 0000 0000. At 1518, replace A975 261F 0683 0000 01A4 by A975 261F 0683 0000 0000. Then open PDEF resource number 5. At offset 508, replace A975 261F 0683 0000 00B4 by A975 261F 0683 0000 0000. At offset 52E, replace A975 261F 0683 0000 01A4 by A975 261F 0683 0000 0000. These offsets are from version 2.7 of the ImageWriter file; in other versions, the offsets may be different, but the strings should be the same. Save your changes and you're done.